#pragma once

#include <string>
#include <stdint.h>
#include <time.h>

#include "Character.h"
#include "SDLInput.h"
#include "Slash.h"
#include "Flare.h"
#include "Quake.h"

struct RGBColor
{
	unsigned char r, g, b;
};

class Boss : public Character
{
public:
	Boss();	
	Boss(int srcX, int srcY, int srcW, int srcH, int dstX, int dstY);
	~Boss();	

	enum Attack { SLASH, QUAKE, FLARE, COUNT };
	
	void SetAttack(bool attack) { isAttacking = attack; }
	void SetShaking(bool shaking) { isShaking = shaking; }
	void SetDying(bool dying) { isDying = dying; }
	void SetRandomAttack(const int attackRange) { randomAttack = floor(rand() % attackRange); }
	int GetRandomAttack() { return randomAttack; }
	void SetSlashPostion(int x, int y) { slashAttack.SetPosition(x, y); }
	void SetQuakePostion(int x, int y) { quake.SetPosition(x, y); }

private:	
	static const int shakeDistance = 5;

	int initalSrcX;
	int currentFrame;
	
	float currentTime;
	float currentTime2;
	float currentTime3;
	float currentTime4;
	float currentTime5;
	float currentTime6;
	float shakeTime;

	bool isDying;
	bool isShaking;
	bool isRandomingColor;
	bool isAttacking;
	bool isAlpha;
	int alphaCount;
	int initialX;
	int initialY;
	int initialColor;
	double randomAttack;

	Flare flare;
	Slash slashAttack;
	Quake quake;

	void Start();
	void Draw();
	void Update();

	void Dying();
	void SetAlpha(const int alphaSpeed);
	void Shaking(const int shakeDuration);
	void RandomColors(const int randomColorsDuration);
	void SlashAttack(const float slashSpeed, const int slashAttackDuration);
	void QuakeAttack(const int quakeSpeed, const int quakeDuration);
	void FlareAttack(const float flareSpeed, const int flareAttackDuration);
};



